package com.sky.mapper;

import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * The interface Setmeal dish mapper.
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 添加套餐中的菜品
     *
     * @param setmealDishes the setmeal dishes
     */
    void insert(List<SetmealDish> setmealDishes);

    /**
     * 根据setmealIds删除
     *
     * @param setmealIds the setmeal ids
     */
    void deleteBySetmealId(List<Long> setmealIds);


    /**
     * 查看套餐id根据菜品id
     *
     * @param dishId the dishId
     * @return the list
     */
    @Select("select  setmeal_id from setmeal_dish where dish_id = #{dishId}")
    List<SetmealDish> selectSetmealByDishId(Long dishId);


    @Select("select id, setmeal_id, dish_id, name, price, copies from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> selectBySetmealId(Long setmealId);



}
